// 主页的所有接口
import request from "../../utils/request";
// 导入ts数据类型
import { HospitalLevelRegionResData, HospitalResponseData } from "./type";
// 通过枚举管理首页接口
enum API{
  // 使用了枚举就可以在枚举中随时修改接口路径
  HoSPITAL_URL = '/api/hosp/hospital/',
  HoSPITAL_REGION = '/admin/cmn/dict/findByDictCode/',
  HoSPITAL_SEARCH = '/api/hosp/hospital/findByHosname/'
}
export const hospital_request = (page:number,pageSize:number,hostype='',districtCode='') => request.get<any,HospitalResponseData>(API.HoSPITAL_URL+`${page}/${pageSize}?hostype=${hostype}&districtCode=${districtCode}`)


// 医院地区和等级的请求
export const hospital_region = (dictCode: string) => request.get<any, HospitalLevelRegionResData>(API.HoSPITAL_REGION + dictCode)
// 搜索框建议
export const hospital_search = (hosname:string)=> request.get<any>(API.HoSPITAL_SEARCH+hosname)
